// 持久层与mysql交互
const adminModel = require("./model/adminModel")
var md5 = require('md5');

module.exports.loginDao = async function(loginInfo){
    const {loginId,loginPwd} = loginInfo
var md5 = require('md5');
    const encode = md5(loginPwd)
    return await adminModel.findOne({
        where:{
            loginId,
            loginPwd:encode
        }
    })
}
                                           
module.exports.updateAdminDao = async function(newAccountInfo){
    return await adminModel.update(newAccountInfo,{
        where: {
            loginId:newAccountInfo.loginId  
        }                                    
    })
}